<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>大奔农庄</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/aui.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>    
    <link rel="stylesheet" href="../../css/swiper.min.css">
    <link rel="stylesheet" href="../../font/iconfont.css">
    
</head>
<body>
	<div class="aui-content" id="myCommentList">
  <!-- 
  	    <div class="aui-list aui-media-list db_pingjia_li_box aui-margin-b-15 nan_bottom">
  	        <div class="aui-list-item aui-list-item-middle db_aui-list-item-middle">
  	            <div class="aui-media-list-item-inner">
  	            	<div class="aui-list-item-media aui-pull-left" style="width:2.7rem">
                  	  <img src="../../image/touxiang.jpg" class="aui-img-round aui-list-img-sm">
                    </div>
                    <div class="aui-list-item-inner db_pingjia_aui-list-item-inner">
  	                    <div class="aui-list-item-text">
  	                        <div class="aui-list-item-title aui-font-size-16">{$vo.nickname}</div>
  	                        <div class="aui-list-item-right">{$vo.createtime}</div>
  	                    </div>
  	                </div>
  	            </div>
  	        </div>
  	        <div class="aui-padded-10" style="margin-left: 65px;">  
  	      		<span class="aui-list-item-text aui-margin-b-10">{$vo.content}</span>
  	        </div>
  	    </div>
  	 -->
	</div>
	<div id="wudongtai_box" class="none">
	 	<img src="../../image/wudongtai.png" id="wudongtai_img" />
		<p id="wudongtai_txt"> </p>
	 </div>	
	 <div class="aui-card-list-footer aui-text-center" id="cd_loading">查看更多</div>   
</body>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript" src="../../script/aui-scroll.js"></script>
<script>
var db_key = 'user',db_user,useParam={},nowpage=1, loadend=false, isloading=false;
apiready = function() {
	db_user = $api.getStorage(db_key);
	loaddata();
}
//监听滚动高度，加载下一页	
var scroll = new auiScroll({
    listen:true, //是否监听滚动高度，开启后将实时返回滚动高度
    distance:10 //判断到达底部的距离，isToBottom为true
},function(ret){
    if (ret.isToBottom) {
        loaddata();//显示更多数据
    }
});
//加载内容
function loaddata() {
	if (loadend) {/*api.toast({msg:'1'});*/return;}
    //禁止重复加载
    if (isloading) {/*api.toast({msg:'2'});*/return;}
    else isloading = true;
    api.showProgress();//显示加载进度框
    $api.removeCls($api.byId("cd_loading"),'none');//显示加载中
    useParam.page = nowpage;

	useParam.rtk = RSapi.myrtk;		
	useParam.mytoken = db_user.mytoken;

	api.ajax({
		url: RSapi.base+RSapi.myCommentList,
		method: 'post',
		cache: false,
		timeout: 30,
		dataType: 'json',
		data: { values: useParam },
	}, function(ret, err){
		if(err){
			//api.toast({msg: JSON.stringify(err)});
			api.alert({msg: err.msg});
		}else {
			if (ret.status==1) { 
				//成功了
				nowpage++;//页数加一
				$api.append($api.byId('myCommentList'),ret.info);
				$api.addCls($api.byId('wudongtai_box'), 'none');//显示无动态框		
				api.parseTapmode();
				eval('status_'+status+'=true;');
			}else if(ret.status==2){
				//没有内容
				$api.html($api.byId('myCommentList'),'');
				loadend = true;
				$api.removeCls($api.byId('wudongtai_box'), 'none');//显示无动态框
				$api.html($api.byId('wudongtai_txt'), ret.info);//显示提示内容
			}else if(ret.status==3){
				//成功了, 但是已经加载完毕
                loadend = true;
                api.toast({msg:ret.info});
			}else {
				//失败了
				api.toast({msg: ret.info});
			}
		}
		$api.addCls($api.byId("cd_loading"),'none');//隐藏加载中
		isloading = false;//加载结束
	});
	api.hideProgress();
}
</script>
</html>